package com.chzc.demo;

import com.chzc.entity.DevilMessage;
import com.chzc.server.DevilConsumer;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

/**
 * @author cv大魔王
 * @version 1.0
 * @date 2021/7/3 10:29
 */
public class ConsumerDemo {

    public static void main(String[] args) {
        DevilConsumer consumer = new DevilConsumer("localhost", 7000 , "pay");
        consumer.start(new SimpleChannelInboundHandler<DevilMessage>() {
            @Override
            protected void channelRead0(ChannelHandlerContext channelHandlerContext, DevilMessage msg) throws Exception {
                System.out.println("消费者获取生产者消息:" + new String(msg.getContent()));
            }
        });
    }

}
